package com.firewolf.springcloud.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.firewolf.springcloud.entities.Dept;
import com.firewolf.springcloud.entities.DeptExample;
import com.firewolf.springcloud.mapper.DeptMapper;

@Service
public class DeptService {
	
	@Autowired
	private DeptMapper dMapper;
	
	public List<Dept> list(){
		return dMapper.selectByExample(new DeptExample());
	}
	
	public Dept findByID(Integer id){
		return dMapper.selectByPrimaryKey(id);
	}
	
	public Integer addDept(Dept d){
		return dMapper.insert(d);
	}
	
	public int deleteDepte(Integer id){
		return dMapper.deleteByPrimaryKey(id);
	}
}
